/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ipccenter.beans;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
import ru.ipccenter.entities.Human;
import ru.ipccenter.entities.Role;

/**
 *
 * @author sm-ni_000
 */
@Stateless
public class RoleBean implements RoleBeanLocal {
    
    //@PersistenceContext(unitName = "WarehousePU", type = PersistenceContextType.TRANSACTION)
    //private EntityManager em;
    
    @Override
    public Role findByHuman(Human man) {
        //Let the role be equals to man's name
        Role simple = new Role();
        simple.setName(man.getFirstName());
        return simple;
    }
    
}
